package com.xframe.xdal.core.tran;

public class DbTransactionContext {

    private static final ThreadLocal<IDbTransaction> container = new ThreadLocal<IDbTransaction>();


    public static void addTransaction(IDbTransaction dbTransaction){
        container.set(dbTransaction);
    }

    public static IDbTransaction getTrans(){
        return container.get();
    }

    public static boolean hasDbTransaction(){
        return container.get() != null;
    }

    public static void remove(){
        container.remove();
    }
}
